This forum is closed to new posts and
responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:
// frist check if user exist
StringBuffer mailserver = new StringBuffer();
StringBuffer mailfile = new StringBuffer();
StringBuffer maildomain = new StringBuffer();
StringBuffer mailsystem = new StringBuffer();
Vector profile = new Vector();
strUser= strUserList[i];
//check if user exist
debugLog.record(DebugLog.HIGH, "check if user exist \t" +strUser+" ......");
try {
reg.getUserInfo(strUser,
mailserver,
mailfile,
maildomain,
mailsystem,
profile);
} catch (NotesException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
// print user's information
debugLog.record(DebugLog.HIGH, "Info for " + strUser + "\n" +
"\tMail server:\t" + mailserver + "\n" +
"\tMail file:\t\t" + mailfile + "\n" +
"\tMail domain:\t" + maildomain + "\n" +
"\tMail system:\t" + mailsystem + "\n" +
"\tProfile:");
for (int n=0; n<profile.size(); n++) {
debugLog.record(DebugLog.HIGH, profile.elementAt(n).toString());
}
// frist check if user exist , exist skip
if( mailfile.length()!=0 )
{
debugLog.record(DebugLog.HIGH, strUser+"is exist");
}
// frist check if user exist ,if not create user and add acl
else
{
//if not exist register a new user
debugLog.record(DebugLog.HIGH, strUser+"is not exist");
debugLog.record(DebugLog.HIGH, "registering user\t" +strUser+" ......");
try {
if (reg.registerNewUser(strUser, // last name
genConf.localpath+strUser+".id", // file to be created /localdata/user.id
genConf.SMDServer, // mail server
"", // first name
"", // middle initial
genConf.cert_pwd, // certifier password
"", // location field
"", // comment field
"mail\\"+strUser+".nsf", // mail file
"", // forwarding domain
genConf.user_pwd)) //user password
{
debugLog.record(DebugLog.HIGH, "user("+strUser+") is created successfully");
}
else
{
debugLog.record(DebugLog.HIGH, "failed to create user("+strUser+")");
}